package org.hdl.anima.proxy;

import org.hdl.anima.AppConf;
import org.hdl.anima.Application;
import org.hdl.anima.message.IMessage;
import org.hdl.anima.transport.RemoteException;

/**
 * 
 * @author qiuhd
 * @since  2014年8月5日
 */
public interface ServerProxy {
	/**
	 * Return the id of this ServerProxy
	 * @return
	 */
	String getId();
	/**
	 * Set up the application of this ServerProxy
	 */
	void setApplication(Application application);
	/**
	 * Return the application
	 * @return
	 */
	Application getApplication();
	/**
	 * Start this ServerProxy
	 */
	void start()throws RemoteException;
	/**
	 * Send message to this ServerProxy
	 * @param rid	receiver id 
	 * @param msg
	 */
	void send(int rid,IMessage msg) throws RemoteException;
	/**
	 * Send message to this ServerProxy
	 * @param rid receiver id 
	 * @param msg
	 */
	void send(int rid,byte[] msg) throws RemoteException;
	
	void send(IMessage message) throws RemoteException;
	/**
	 * Stop this ServerProxy
	 */
	void stop();
	/**
	 * Is available
	 * @return
	 */
	boolean isAvailable();
	/**
	 * Return te configuration
	 * @return
	 */
	ServerProxyConfig getConifg();
	
	AppConf getAppConf();
}

